SRCS = console.c

OBJS := $(patsubst %.c, %.o, $(filter %.c, $(SRCS)))
OBJS += $(patsubst %.S, %.o, $(filter %.S, $(SRCS)))
DEPS := $(patsubst %.o, %.d, $(OBJS))

.S.o:
	@echo "$(PURPLE)CC$(RESET)\t$(path)/$(PURPLE)$<$(RESET)"
	@$(CC) $(CFLAGS) -D__ASSEMBLER__ -MMD -MF $*.d -MT $@ -c $< -o $@

.c.o:
	@echo "$(YELLOW)CC$(RESET)\t$(path)/$(YELLOW)$<$(RESET)"
	@$(CC) $(CFLAGS) -MMD -MF $*.d -MT $@ -c $< -o $@

all: char.a

char.a: $(OBJS)
	@echo "$(LBLUE)AR$(RESET)\t$@"
	@$(AR) rcs char.a $(OBJS)
	@sync

-include $(DEPS)
